<template>
  <div class="app-container">
    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px">
      <el-form-item label="投保人名称" prop="toubaoId">
        <el-select v-model="queryParams.toubaoId" placeholder="请选择投保人名称" clearable>
          <el-option
              v-for="dict in taobaoList"
              :key="dict.deptId"
              :label="dict.deptName"
              :value="dict.deptId"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="被保险人名称" prop="beibaoId">
        <el-select v-model="queryParams.beibaoId" placeholder="请选择被保险人名称" clearable>
          <el-option
              v-for="dict in taobaoList"
              :key="dict.deptId"
              :label="dict.deptName"
              :value="dict.deptId"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="保险人名称" prop="baoxianId">
        <el-select v-model="queryParams.baoxianId" placeholder="请选择保险人名称" clearable>
          <el-option
              v-for="dict in baoxianList"
              :key="dict.deptId"
              :label="dict.deptName"
              :value="dict.deptId"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="经纪/代理公司名称" prop="proxyId" label-width="130px">
        <el-select v-model="queryParams.proxyId" placeholder="请选择经纪/代理公司名称" clearable>
          <el-option
              v-for="dict in proxyList"
              :key="dict.deptId"
              :label="dict.deptName"
              :value="dict.deptId"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="险种" prop="insureType" label-width="50">
        <el-select v-model="queryParams.insureType" placeholder="险种" clearable>
          <el-option
              v-for="dict in dict.type.insure_type"
              :key="dict.value"
              :label="dict.label"
              :value="dict.value"
          />
        </el-select>
      </el-form-item>
      <el-form-item>
        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
      </el-form-item>
    </el-form>

    <!--<el-row :gutter="10" class="mb8">-->
    <!--   <el-col :span="1.5">-->
    <!--     <el-button-->
    <!--         type="primary"-->
    <!--         plain-->
    <!--         icon="el-icon-plus"-->
    <!--         size="mini"-->
    <!--         @click="handleAdd"-->
    <!--         v-hasPermi="['insurance:insureManage:add']"-->
    <!--     >新增-->
    <!--     </el-button>-->
    <!--   </el-col>-->
    <!--   <el-col :span="1.5">-->
    <!--     <el-button-->
    <!--         type="success"-->
    <!--         plain-->
    <!--         icon="el-icon-edit"-->
    <!--         size="mini"-->
    <!--         :disabled="single"-->
    <!--         @click="handleUpdate"-->
    <!--         v-hasPermi="['insurance:insureManage:edit']"-->
    <!--     >修改-->
    <!--     </el-button>-->
    <!--   </el-col>-->
    <!--   <el-col :span="1.5">-->
    <!--     <el-button-->
    <!--         type="danger"-->
    <!--         plain-->
    <!--         icon="el-icon-delete"-->
    <!--         size="mini"-->
    <!--         :disabled="multiple"-->
    <!--         @click="handleDelete"-->
    <!--         v-hasPermi="['insurance:insureManage:remove']"-->
    <!--     >删除-->
    <!--     </el-button>-->
    <!--   </el-col>-->
    <!--   &lt;!&ndash;<el-col :span="1.5">&ndash;&gt;-->
    <!--   &lt;!&ndash;  <el-button&ndash;&gt;-->
    <!--   &lt;!&ndash;      type="warning"&ndash;&gt;-->
    <!--   &lt;!&ndash;      plain&ndash;&gt;-->
    <!--   &lt;!&ndash;      icon="el-icon-download"&ndash;&gt;-->
    <!--   &lt;!&ndash;      size="mini"&ndash;&gt;-->
    <!--   &lt;!&ndash;      @click="handleExport"&ndash;&gt;-->
    <!--   &lt;!&ndash;      v-hasPermi="['insurance:insureManage:export']"&ndash;&gt;-->
    <!--   &lt;!&ndash;  >导出</el-button>&ndash;&gt;-->
    <!--   &lt;!&ndash;</el-col>&ndash;&gt;-->
    <!--   <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>-->
    <!-- </el-row>-->

    <el-table v-loading="loading" :data="insureManageList" border @selection-change="handleSelectionChange">
      <el-table-column type="selection" width="55" align="center"/>
      <el-table-column label="保险合同名称" align="center" prop="contractName" :min-width="100"/>
      <el-table-column label="保单号码" align="center" prop="insureNo" :min-width="100"/>
      <el-table-column label="投保人名称" align="center" prop="toubaoName" :min-width="100">
      </el-table-column>
      <el-table-column label="保险人名称" align="center" prop="baoxianName" :min-width="100">

      </el-table-column>
      <el-table-column label="被保险人名称" align="center" prop="beibaoName" :min-width="100">
      </el-table-column>
      <el-table-column label="经纪/代理公司名称" align="center" prop="proxyName" :min-width="130">
      </el-table-column>
      <el-table-column label="险种" align="center" prop="insureType" :min-width="100">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.insure_type" :value="scope.row.insureType"/>
        </template>
      </el-table-column>
      <el-table-column label="保险金额(元)" align="center" prop="insureAmount" :min-width="100"/>
      <el-table-column label="保险费率(%)" align="center" prop="insureRate" :min-width="100"/>
      <el-table-column label="保费(元)" align="center" prop="premium" :min-width="100"/>
      <el-table-column label="已决赔款(元)" align="center" prop="completeAmount" :min-width="100"/>
      <el-table-column label="已决赔付率(%)" align="center" prop="rate" :min-width="110"/>
      <el-table-column label="已收风控及技术服务费" align="center" prop="riskAmountReal" :min-width="100"/>
      <el-table-column label="未收风控及技术服务费" align="center" prop="riskAmountNot" :min-width="100"/>
      <!--<el-table-column label="保单期限" align="center" prop="insureLimit" width="180">-->
      <!--  <template slot-scope="scope">-->
      <!--    <span>{{ parseTime(scope.row.insureLimit, '{y}-{m}-{d}') }}</span>-->
      <!--  </template>-->
      <!--</el-table-column>-->
      <el-table-column label="保险期限" align="center">
        <el-table-column label="起始日期" align="center" prop="insureStartDate" width="180">
          <template slot-scope="scope">
            <span>{{ parseTime(scope.row.insureStartDate, '{y}-{m}-{d} {h}') }}</span>
          </template>
        </el-table-column>
        <el-table-column label="终止日期" align="center" prop="insureEndDate" width="180">
          <template slot-scope="scope">
            <span>{{ parseTime(scope.row.insureEndDate, '{y}-{m}-{d} {h}') }}</span>
          </template>
        </el-table-column>
      </el-table-column>
      <el-table-column label="保险合同" align="center" prop="rate" :min-width="100">
        <template slot-scope="scope">
          <el-link type="primary" @click="toBaoXian(scope.row,1)"> 详情</el-link>
        </template>
      </el-table-column>
      <el-table-column label="理赔信息" align="center" prop="rate" :min-width="100">
        <template slot-scope="scope">
          <el-link type="primary" @click="toBaoXian(scope.row,2)"> 详情</el-link>
        </template>
      </el-table-column>
      <el-table-column label="风控信息" align="center" prop="rate" :min-width="100">
        <template slot-scope="scope">
          <el-link type="primary" @click="toBaoXian(scope.row,3)"> 详情</el-link>
        </template>
      </el-table-column>
      <el-table-column label="共保信息" align="center" prop="rate" :min-width="100">
        <template slot-scope="scope">
          <el-link type="primary" @click="toBaoXian(scope.row,4)"> 详情</el-link>
        </template>
      </el-table-column>
      <!--<el-table-column label="操作" align="center" class-name="small-padding fixed-width">-->
      <!--  <template slot-scope="scope">-->
      <!--    <el-button-->
      <!--        size="mini"-->
      <!--        type="text"-->
      <!--        icon="el-icon-edit"-->
      <!--        @click="handleUpdate(scope.row)"-->
      <!--        v-hasPermi="['insurance:insureManage:edit']"-->
      <!--    >修改-->
      <!--    </el-button>-->
      <!--    <el-button-->
      <!--        size="mini"-->
      <!--        type="text"-->
      <!--        icon="el-icon-delete"-->
      <!--        @click="handleDelete(scope.row)"-->
      <!--        v-hasPermi="['insurance:insureManage:remove']"-->
      <!--    >删除-->
      <!--    </el-button>-->
      <!--  </template>-->
      <!--</el-table-column>-->
    </el-table>

    <pagination
        v-show="total>0"
        :total="total"
        :page.sync="queryParams.pageNum"
        :limit.sync="queryParams.pageSize"
        @pagination="getList"
    />

    <!-- 添加或修改保险对话框 -->
    <el-dialog :title="title" :visible.sync="open" width="1000px" append-to-body v-dialogDrag
               :close-on-click-modal="false">
      <el-form ref="form" :model="form" :rules="rules" label-width="110px">
        <el-card shadow="never" :body-style="{ height: '10px' }" style="margin-bottom: 10px">
          <el-descriptions title="合同主体信息"/>
          <el-row>
            <el-col :span="12">
              <el-form-item label="投保人名称" prop="toubaoId">
                <el-select v-model="form.toubaoId" placeholder="请选择投保人名称">
                  <el-option
                      v-for="dict in taobaoList"
                      :key="dict.deptId"
                      :label="dict.deptName"
                      :value="dict.deptId"
                  ></el-option>
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="被保险人名称" prop="beibaoId">
                <el-select v-model="form.beibaoId" placeholder="请选择被保险人名称">
                  <el-option
                      v-for="dict in beibaoList"
                      :key="dict.deptId"
                      :label="dict.deptName"
                      :value="dict.deptId"
                  ></el-option>
                </el-select>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="12">
              <el-form-item label="保险人名称" prop="baoxianId">
                <el-select v-model="form.baoxianId" placeholder="请选择保险人名称">
                  <el-option
                      v-for="dict in baoxianList"
                      :key="dict.deptId"
                      :label="dict.deptName"
                      :value="dict.deptId"
                  ></el-option>
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="经纪/代理公司名称" prop="proxyId">
                <el-select v-model="form.proxyId" placeholder="请选择经纪/代理公司名称">
                  <el-option
                      v-for="dict in proxyList"
                      :key="dict.deptId"
                      :label="dict.deptName"
                      :value="dict.deptId"
                  ></el-option>
                </el-select>
              </el-form-item>
            </el-col>
          </el-row>
        </el-card>
        <el-card shadow="never" :body-style="{ padding: '10px'}" style="margin-bottom: 10px">
          <el-descriptions title="保单信息"/>
          <el-form-item label="保单号码" prop="insureNo">
            <el-input v-model="form.insureNo" placeholder="请输入保单号码"/>
          </el-form-item>
          <el-row>
            <el-col :span="12">
              <el-form-item label="保险合同名称" prop="contractName">
                <el-input v-model="form.contractName" placeholder="请输入保险合同名称"/>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="险种" prop="insureType">
                <el-select v-model="form.insureType" placeholder="险种" clearable>
                  <el-option
                      v-for="dict in dict.type.insure_type"
                      :key="dict.value"
                      :label="dict.label"
                      :value="dict.value"
                  />
                </el-select>
              </el-form-item>
            </el-col>
          </el-row>
          <el-form-item label="保单期限" prop="insureLimit">
            <el-date-picker clearable
                            v-model="form.insureLimit"
                            type="date"

                            style="width: 100%"
                            value-format="yyyy-MM-dd"
                            placeholder="请选择保单期限">
            </el-date-picker>
          </el-form-item>
          <el-row>
            <el-col :span="12">
              <el-form-item label="保单起期" prop="insureStartDate">
                <el-date-picker clearable
                                v-model="form.insureStartDate"
                                type="datetime"
                                value-format="yyyy-MM-dd HH:mm"
                                format="yyyy-MM-dd HH:mm"
                                placeholder="请选择保单起期">
                </el-date-picker>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="保单止期" prop="insureEndDate">
                <el-date-picker clearable
                                v-model="form.insureEndDate"
                                type="datetime"
                                value-format="yyyy-MM-dd HH:mm"
                                format="yyyy-MM-dd HH:mm"
                                placeholder="请选择保单止期">
                </el-date-picker>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="12">
              <el-form-item label="保险金额" prop="insureAmount">
                <el-input v-model="form.insureAmount" placeholder="请输入保险金额"/>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="保险费率" prop="insureRate">
                <el-input v-model="form.insureRate" placeholder="请输入保险费率"/>
              </el-form-item>
            </el-col>
          </el-row>
          <el-form-item label="保费" prop="premium">
            <el-input v-model="form.premium" readonly placeholder="保费"/>
          </el-form-item>
        </el-card>
        <el-card shadow="never" :body-style="{ padding: '10px'}" style="margin-bottom: 10px">
          <el-descriptions title="标的信息"/>
          <el-row>
            <el-col :span="12">
              <el-form-item label="标的地址" prop="targetAddress">
                <el-input v-model="form.targetAddress" placeholder="请输入标的地址">
                  <template slot="append">
                    <el-button slot="append" @click="openMap"> 地图</el-button>
                  </template>
                </el-input>
              </el-form-item>
              <!--<el-form-item label="标的经度" prop="longitude">-->
              <!--  <el-input v-model="form.longitude" placeholder="请输入标的经度" />-->
              <!--</el-form-item>-->
              <!--<el-form-item label="标的纬度" prop="latitude">-->
              <!--  <el-input v-model="form.latitude" placeholder="请输入标的纬度" />-->
              <!--</el-form-item>-->
            </el-col>
            <el-col :span="12">
              <el-form-item label="标的内容">
                <el-input v-model="form.targetContent" placeholder="请输入标的地址" type="textarea" :rows="1"/>
              </el-form-item>
            </el-col>
          </el-row>
        </el-card>
        <el-card shadow="never" :body-style="{ padding: '10px'}" style="margin-bottom: 10px">
          <el-descriptions title="经纪/代理信息"/>
          <el-row>
            <el-col :span="12">
              <el-form-item label="经纪/代理公司" prop="proxyId" label-width="110px">
                <!--<el-input v-model="form.proxyId" placeholder="请输入经纪/代理公司"/>-->
                <el-select v-model="form.proxyId" placeholder="请选择经纪/代理公司名称">
                  <el-option
                      v-for="dict in proxyList"
                      :key="dict.deptId"
                      :label="dict.deptName"
                      :value="dict.deptId"
                  ></el-option>
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="经纪/代理佣金比例" prop="commissionRate">
                <el-input v-model="form.commissionRate" placeholder="请输入经纪/代理佣金比例"/>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="12">
              <el-form-item label="经纪/代理佣金" prop="commission">
                <el-input v-model="form.commission" placeholder="请输入经纪/代理佣金"/>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="经纪/代理佣金支付证明上传" prop="fileIds">
                <!--<el-input v-model="form.commission" placeholder="请输入经纪/代理佣金"/>-->
                <file-upload v-model="form.fileIds" :limit="1"></file-upload>
              </el-form-item>
            </el-col>
          </el-row>


        </el-card>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>
    <contract-detail ref="contractDetailRef" @closeDialog="getList" ></contract-detail>
    <co-insurance-detail ref="coInsuranceDetailRef"  @closeDialog="getList"></co-insurance-detail>
    <risk-detail ref="riskDetailRef"  @closeDialog="getList"></risk-detail>
    <settle-detail ref="settleDetailRef" @closeDialog="getList"></settle-detail>
    <el-dialog
        title="选取区域"
        :visible.sync="areaShow"
        width="1000px"
        append-to-body
    >
      <drawLineOLWindow
          v-if="areaShow"
          @coordinate="coordinate"
          class="pointChoose"
          :defaultCoord="this.form.targetAddress"
      />
      <el-button type="primary" @click="savePoint" style="margin-top: 5px"
      >确定</el-button   >
    </el-dialog>
  </div>
</template>

<script>
import {
  listInsureManage,
  getInsureManage,
  delInsureManage,
  addInsureManage,
  updateInsureManage, getMainList
} from "@/api/insurance/insureManage";
import {getBaoxianlist, getDaililist, getFengkonglist, getToubaolist} from "@/api/common/common";
import contractDetail from "./detail/contract";
import coInsuranceDetail from "./detail/coInsuranceDetail";
import riskDetail from "@/views/insurance/insureManage/detail/riskDetail.vue";
import settleDetail from "@/views/insurance/insureManage/detail/settleDetail.vue";
import drawLineOLWindow from "@/components/OpenLayersWindow/choosePointOLWindow/index";

export default {
  name: "InsureManage",
  dicts: ['insure_type'],
  components: {contractDetail, coInsuranceDetail, riskDetail, settleDetail,drawLineOLWindow},
  data() {
    return {
      areaShow:false,
      showcontractDetailRef:false,
      proxyList: [],
      baoxianList: [],
      taobaoList: [],
      beibaoList: [],
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      // 子表选中数据
      checkedTbInsuranceContractPremiumPlan: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 保险表格数据
      insureManageList: [],
      // 保险合同回款计划表格数据
      tbInsuranceContractPremiumPlanList: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        toubaoId: null,
        beibaoId: null,
        baoxianId: null,
        proxyId: null,
        insureNo: null,
        contractName: null,
        insureType: null,
        insureLimit: null,
        insureStartDate: null,
        insureEndDate: null,
        insureAmount: null,
        insureRate: null,
        premium: null,
      },
      // 表单参数
      form: {},
      // 表单校验
      rules: {
        id: [
          {required: true, message: "主键不能为空", trigger: "blur"}
        ],
      }
    };
  },
  created() {
    this.getList();
    this.initData()
  },
  methods: {
    savePoint() {
      this.areaShow = false;
    },
    coordinate(val) {
      debugger
      this.form.targetAddress = val;
    },
    toBaoXian(row, type) {
      const _this = this

      switch (type) {
        case 1:
          _this.$refs.contractDetailRef.openDialog(row.id)
          break;
        case 2:
          _this.$refs.settleDetailRef.openDialog(row.id)
          break;
        case 3:
          _this.$refs.riskDetailRef.openDialog(row.id)
          break;
        case 4:
          _this.$refs.coInsuranceDetailRef.openDialog(row.id)
          break;
      }
      // this.$modal.msg('还没有跳转，合同id=>'+row.id)
    },
    openMap() {
      this.$modal.msg('打开地图')
    },
    initData() {
      getToubaolist().then().then(res => {
        this.taobaoList = res.data
      })
      getFengkonglist().then().then(res => {
        this.beibaoList = res.data
      })
      getBaoxianlist().then().then(res => {
        this.baoxianList = res.data
      })
      getDaililist().then().then(res => {
        this.proxyList = res.data
      })
    },
    /** 查询保险列表 */
    getList() {
      this.loading = false;
      this.loading = true;
      getMainList(this.queryParams).then(response => {
        this.insureManageList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    // 取消按钮
    cancel() {
      this.open = false;
      this.reset();
    },
    // 表单重置
    reset() {
      this.form = {
        id: null,
        toubaoId: null,
        beibaoId: null,
        baoxianId: null,
        proxyId: null,
        insureNo: null,
        contractName: null,
        insureType: null,
        insureLimit: null,
        insureStartDate: null,
        insureEndDate: null,
        insureAmount: null,
        insureRate: null,
        premium: null,
        delFlag: null,
        createBy: null,
        createTime: null,
        updateBy: null,
        updateTime: null,
        insureId: null,
        targetAddress: null,
        longitude: null,
        latitude: null,
        targetContent: null,
        commissionRate: null,
        commission: null,
        fileIds: []
      };
      this.tbInsuranceContractPremiumPlanList = [];
      this.resetForm("form");
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.resetForm("queryForm");
      this.handleQuery();
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map(item => item.id)
      this.single = selection.length !== 1
      this.multiple = !selection.length
    },
    /** 新增按钮操作 */
    handleAdd() {
      this.reset();
      this.open = true;
      this.title = "添加保险";
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      this.reset();
      const id = row.id || this.ids
      getInsureManage(id).then(response => {
        this.form = response.data;
        this.tbInsuranceContractPremiumPlanList = response.data.tbInsuranceContractPremiumPlanList;
        this.open = true;
        this.title = "修改保险";
      });
    },
    /** 提交按钮 */
    submitForm() {
      this.$refs["form"].validate(valid => {
        if (valid) {
          this.form.tbInsuranceContractPremiumPlanList = this.tbInsuranceContractPremiumPlanList;
          if (this.form.id != null) {
            updateInsureManage(this.form).then(response => {
              this.$modal.msgSuccess("修改成功");
              this.open = false;
              this.getList();
            });
          } else {
            addInsureManage(this.form).then(response => {
              this.$modal.msgSuccess("新增成功");
              this.open = false;
              this.getList();
            });
          }
        }
      });
    },
    /** 删除按钮操作 */
    handleDelete(row) {
      const ids = row.id || this.ids;
      this.$modal.confirm('是否确认删除保险编号为"' + ids + '"的数据项？').then(function () {
        return delInsureManage(ids);
      }).then(() => {
        this.getList();
        this.$modal.msgSuccess("删除成功");
      }).catch(() => {
      });
    },
    /** 保险合同回款计划序号 */
    rowTbInsuranceContractPremiumPlanIndex({row, rowIndex}) {
      row.index = rowIndex + 1;
    },
    /** 保险合同回款计划添加按钮操作 */
    handleAddTbInsuranceContractPremiumPlan() {
      let obj = {};
      obj.insureId = "";
      obj.planName = "";
      obj.planAmount = "";
      obj.planDate = "";
      obj.rate = "";
      obj.demand = "";
      obj.responsiblePerson = "";
      this.tbInsuranceContractPremiumPlanList.push(obj);
    },
    /** 保险合同回款计划删除按钮操作 */
    handleDeleteTbInsuranceContractPremiumPlan() {
      if (this.checkedTbInsuranceContractPremiumPlan.length == 0) {
        this.$modal.msgError("请先选择要删除的保险合同回款计划数据");
      } else {
        const tbInsuranceContractPremiumPlanList = this.tbInsuranceContractPremiumPlanList;
        const checkedTbInsuranceContractPremiumPlan = this.checkedTbInsuranceContractPremiumPlan;
        this.tbInsuranceContractPremiumPlanList = tbInsuranceContractPremiumPlanList.filter(function (item) {
          return checkedTbInsuranceContractPremiumPlan.indexOf(item.index) == -1
        });
      }
    },
    /** 复选框选中数据 */
    handleTbInsuranceContractPremiumPlanSelectionChange(selection) {
      this.checkedTbInsuranceContractPremiumPlan = selection.map(item => item.index)
    },
    /** 导出按钮操作 */
    handleExport() {
      this.download('insurance/insureManage/export', {
        ...this.queryParams
      }, `insureManage_${new Date().getTime()}.xlsx`)
    }
  }
};
</script>

<style lang="scss" scoped>
::v-deep .el-descriptions {
  &:not(:nth-child(1)) {
    margin-top: 20px;
  }

  .el-descriptions__title {
    display: flex;
    align-items: center;

    &::before {
      display: inline-block;
      width: 3px;
      height: 20px;
      margin-right: 10px;
      background-color: #409eff;
      content: '';
    }
  }

  .el-descriptions-item__container {
    margin: 0 10px;

    .no-colon {
      margin: 0;

      &::after {
        content: '';
      }
    }
  }
}
</style>
